package mtm.ui.list;

import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.Serializable;

import javax.swing.JLabel;

import mtm.db.Job;

/**
 * Item of custom list
 * @author CondorHero89
 *
 */
public class JobItem extends JLabel implements Serializable {
	
	private Color color;
	private String value;
	private boolean isDragable = true;
	private boolean hasToolTip = true;
	private Job job = null;
	
	/**
	 * Constructor
	 * @param job
	 */
	public JobItem(Job job) {
		this.color = new Color(job.getColor());
		this.value = job.getJobName();
		this.job = job;
	}
	
	
	/**
	 * Constructor
	 * @param color
	 * @param value
	 */
	public JobItem(Color color, String value) {
		this.color = color;
		this.value = value;
	}
	
	
	/**
	 * Constructor
	 */
	public JobItem() {
		this(Color.WHITE, "                    ");
	}

	
	/**
	 * 
	 * @return color of item
	 */
	public Color getColor() {
		return color;
	}

	
	/**
	 * 
	 * @return text of item
	 */
	public String getValue() {
		return value;
	}
	
	
	public boolean isDragable() {
		return isDragable;
	}


	public void setDragable(boolean isDragable) {
		this.isDragable = isDragable;
	}


	public boolean isHasToolTip() {
		return hasToolTip;
	}


	public void setHasToolTip(boolean hasToolTip) {
		this.hasToolTip = hasToolTip;
	}
	
	
	public int getId() {
		return this.job.getId();
	}
	
	
	public Job getJob() {
		return job;
	}
	
	
	public void setJob(Job job) {
		this.job = job;
	}
	
}
